<?php include '../public/header.php' ?>
<?php include '../public/header_index.php' ?>
<link rel="stylesheet" type="text/css" href="/static/component/laytp/module/cityPicker/city-picker.css">
<style>
    html{background-color: #FFFFFF;}
    body{width: 100%;height: 100%}
    .conindex{padding: 20px 20px;background-color: #FFFFFF;width: calc(100% - 40px);;height: calc(100% - 40px);background:url(/static/admin/images/huan.png);background-size:100% 100%;background-repeat:no-repeat;}
    .gao{background-color: #FFFFFF;height: 34px;width:calc(100% - 40px);padding: 0 20px;border-radius: 5px;padding-top: 4px;box-shadow: 2px 2px 3px #555}
    .gao .tits{height: 30px;line-height: 30px;position: relative}
    .gao .tits .shangpng{position: absolute;top: 2px;left: -10px;width: 25px;height: 25px}
    .huanlogo{position: fixed;bottom: 70px;text-align: right;width: 100%;right: 20px}
    #subbutss{position: absolute;top: 0;right: -65px;height: 30px;line-height: 30px;background-color: rgba(34, 114, 235, 0.8)!important;}
    .enbox .enkuai{width: calc(33.3% - 10px);background-color: rgba(34, 114, 235, 0.3);float: left;margin: 10px 10px 0 0;
        border-radius: 5px;box-shadow: 3px 3px 5px #555;color: #FFFFFF;font-size: 13px!important;position: relative;padding-bottom:18px}
    .enbox .enkuai:nth-child(3){width: calc(33.3%);margin-right: 0}
    .enbox .enkuai:nth-child(6){width: calc(33.3%);margin-right: 0}
    .enbox .enkuai:hover{cursor: pointer;background-color: rgba(34, 114, 235, 0.8)}
    .enbox .enkuai .enpp{padding: 0 10px 0 80px;}
    .enbox .enkuai .enicon{position: absolute;top: 15px;left: 25px;width: 40px;height: 40px}
    .enbox .enkuai .enstate{position: absolute;top: 55px;left: 31px;width: 40px;height: 40px}
    .enbox .enkuai .enname{font-size: 16px!important;font-weight: 600;padding-top: 20px;padding-bottom: 10px;
        overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
    .enbox .enkuai .entt{padding-top: 2px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
    .haveshen{float: left;width: 80%;background-color: unset!important;}
    .noshen{float: left;width: calc(20% - 20px);margin-left: 20px}
    .shbox{padding-top: 13px}
    .shbox .shkuai{width: 100%;height: 81px;margin-bottom: 10px;border-radius: 5px;background-color: rgba(255, 255, 255, 0.3);
        box-shadow: 3px 3px 5px #555;position: relative;line-height: 81px;cursor: pointer;}
    .shbox .shkuai:hover{background-color: rgba(255, 255, 255, 0.8);}
    .shbox .shkuai .shicon{position: absolute;top: 35px;left: 60px;width: 25px;height: 25px}
    .shbox .shkuai .shtit{font-size: 16px;margin-left: 10px}
    /*.shbox .shkuai .shnum{font-size: 20px;color: #FEA918;margin-left: 50px}*/
    .shbox .shkuai .shnum{font-size: 20px;color: #FFFFFF;margin-left: 50px}


    .flip {
        animation: flip 5s infinite;
    }

    @keyframes flip {
        0% {
            transform: scaleX(1) scaleY(1);
        }
        50% {
            transform: scaleX(-1) scaleY(1);
        }
        100% {
            transform: scaleX(1) scaleY(1);
        }
    }
</style>
<body class="laytp-container">
<div class="conindex">
    <div class="layui-card baoinfo">
        <div class="gao">
            <div class="tits">
                <img class="shangpng" src="/static/admin/images/home/shang.png" alt="">
                <span class="colorlan" style="float: left;margin-left: 20px;font-size: 16px"><b>文件上报</b></span>
                <div class="layui-col-md6" style="width: 500px">
                    <div class="layui-input-block" style="z-index: 1;margin-left: 10px;height: 30px">
                        <input type="text" name="areas" id="areas" placeholder="请选择区域" readonly clearable autocomplete="off" class="layui-input" style="height: 30px;line-height: 30px">
                        <button class="laytp-btn laytp-btn-md laytp-btn-primary" type="button" id="subbutss"><i class="layui-icon layui-icon-search"></i>查询</button>
                    </div>
                </div>
                <span class="colorlan" style="float: right" onclick="auth_but_func_engin_more()"><b>更多</b></span>
            </div>
        </div>
        <div style="clear: both"></div>
        <div class="enbox"></div>
    </div>
    <div class="layui-right noshen layui-hide">
        <div class="gao">
            <div class="tits">
                <img class="shangpng" src="/static/admin/images/home/shen.png" alt="">
                <span class="colorlan" style="float: left;margin-left: 20px;font-size: 16px"><b>审批待办</b></span>
            </div>
        </div>
        <div class="shbox">
            <div class="shkuai" onclick="auth_but_func_shen_bao()">
                <div style="text-align: center"><i class="layui-icon layui-icon-file-b"></i><span class="shtit">文件待审</span><span class="shnum nums_bao">0</span></div>
            </div>
            <div class="shkuai" onclick="auth_but_func_shen_shi()">
                <div style="text-align: center"><i class="layui-icon layui-icon-date"></i><span class="shtit">施工日志</span><span class="shnum nums_shi">0</span></div>
            </div>
            <div class="shkuai" onclick="auth_but_func_shen_jian()">
                <div style="text-align: center"><i class="layui-icon layui-icon-form"></i><span class="shtit">监理日志</span><span class="shnum nums_jian">0</span></div>
            </div>
            <div class="shkuai" onclick="auth_but_func_shen_yue()">
                <div style="text-align: center"><i class="layui-icon layui-icon-table"></i><span class="shtit">进度月报</span><span class="shnum nums_yue">0</span></div>
            </div>
        </div>
    </div>
</div>
<div class="huanlogo"><img class="zhuanimg" src="/static/admin/images/huanlogo.png"></div>


<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script>
    window.onload = function() {
        setInterval(function() {
            $(".zhuanimg").addClass('flip');
            setTimeout(function () {
                $(".zhuanimg").removeClass('flip');
            },5000)
        }, 120000);
    };



    var areasFirst = 0;
    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;

        ajax_func_engin();
        ajax_func_shen();
        setInterval(function(){
            ajax_func_engin();
            ajax_func_shen();
        },120000);

        $("#subbutss").click(function () {
            var areas = $("#areas").val();
            ajax_func_engin(areas);
        });

        function ajax_func_engin(areas='') {

            facade.ajax({url: ask_home_engin_list,data:{areas:areas}}).done(function(res){
                if (res.code === 2000) {
                    if(areasFirst < 1){
                        load_areas('areas', res.data.areas, 3);
                        areasFirst = 1;
                    }
                    var data = res.data.data;
                    var str = '';
                    for (var key in data){
                        str +='<div class="enkuai" onclick="get_bao_info('+data[key].id+')">';
                        str +='<img class="enicon" src="/static/admin/images/home/en.png">';
                        str +='<span class="enstate">'+data[key].state_namemob+'</span>';
                        str +='<div class="enpp enname" title="'+data[key].name+'">'+data[key].name+'</div>';
                        str +='<div class="enpp entt">项目地点：<span>'+data[key].areas+'</span></div>';
                        str +='<div class="enpp entt">合同金额：<span>'+parseFormatNum(data[key].hemoney)+'</span></div>';
                        str +='<div class="enpp entt">已完成工程量金额：<span>'+parseFormatNum(data[key].chanfee)+'</span></div>';
                        str +='<div class="enpp entt">计划开竣工：<span>'+data[key].planstartdt+' 至 '+data[key].planenddt+'</span></div>';
                        str +='<div class="enpp entt">实际开竣工：<span>'+data[key].startdt+' 至 '+data[key].enddt+'</span></div>';
                        str +='</div>';
                    }
                    $(".enbox").html(str);


                    render_from();
                }
            });
        }


        function ajax_func_shen() {
            facade.ajax({url: ask_home_shen_list}).done(function(res){
                if (res.code === 2000) {
                    if(res.data.isshow){
                        $(".baoinfo").addClass('haveshen');
                        $(".noshen").removeClass('layui-hide');

                        var list = res.data.list;
                        var str = '';
                        for (var key in list){
                            $(".nums_"+list[key].name).html(list[key].num)
                        }
                    }else{
                        $(".baoinfo").removeClass('haveshen');
                        $(".noshen").addClass('layui-hide');
                    }
                    render_from();
                }
            });
        }

    });






    function get_bao_info(id){
        openPage('../engin_bao/list.php?id='+id)
    }


    function auth_but_func_engin_more(){
        openNavPage('文件上报','engin_bao/index.php');
    }


    function auth_but_func_shen_bao(){
        openNavPage('文件上报','shen_bao/index.php');
    }
    function auth_but_func_shen_shi(){
        openNavPage('施工日志','shen_shi/index.php');
    }
    function auth_but_func_shen_jian(){
        openNavPage('监理日志','shen_jian/index.php');
    }
    function auth_but_func_shen_yue(){
        openNavPage('进度月报','shen_yue/index.php');
    }
</script>
</body>
</html>
